/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.dao.db;

import java.io.Serializable;
import com.baidu.bjf.remoting.protobuf.Codec;
import com.baidu.bjf.remoting.protobuf.ProtobufProxy;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import com.jili.ubert.code.CodeTool;
import java.io.IOException;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dragon
 */
@Entity
@Table(name = "safe_otheraccess")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "SafeOtherAccess.findAll", query = "SELECT s FROM SafeOtherAccess s"),
    @NamedQuery(name = "SafeOtherAccess.findByUserID", query = "SELECT s FROM SafeOtherAccess s WHERE s.userID = :userID"),
    @NamedQuery(name = "SafeOtherAccess.findByMaxOnline", query = "SELECT s FROM SafeOtherAccess s WHERE s.maxOnline = :maxOnline"),
    @NamedQuery(name = "SafeOtherAccess.findByLevelPrice", query = "SELECT s FROM SafeOtherAccess s WHERE s.levelPrice = :levelPrice"),
    @NamedQuery(name = "SafeOtherAccess.findByDev", query = "SELECT s FROM SafeOtherAccess s WHERE s.dev = :dev"),
    @NamedQuery(name = "SafeOtherAccess.findByReseach", query = "SELECT s FROM SafeOtherAccess s WHERE s.reseach = :reseach"),
    @NamedQuery(name = "SafeOtherAccess.findByReBack", query = "SELECT s FROM SafeOtherAccess s WHERE s.reBack = :reBack"),
    @NamedQuery(name = "SafeOtherAccess.findByTrade", query = "SELECT s FROM SafeOtherAccess s WHERE s.trade = :trade"),
    @NamedQuery(name = "SafeOtherAccess.findByOwnUserID", query = "SELECT s FROM SafeOtherAccess s WHERE s.ownUserID = :ownUserID"),
    @NamedQuery(name = "SafeOtherAccess.findByAlterUserID", query = "SELECT s FROM SafeOtherAccess s WHERE s.alterUserID = :alterUserID"),
    @NamedQuery(name = "SafeOtherAccess.findByCreateTime", query = "SELECT s FROM SafeOtherAccess s WHERE s.createTime = :createTime"),
    @NamedQuery(name = "SafeOtherAccess.findByTimeStamp", query = "SELECT s FROM SafeOtherAccess s WHERE s.timeStamp = :timeStamp")})
public class SafeOtherAccess implements Serializable {
	public static byte[] EnCode(SafeOtherAccess msg) throws IOException {
		Codec<SafeOtherAccess> Lcode = ProtobufProxy.create(SafeOtherAccess.class);
		return Lcode.encode(msg);
	}
	public static SafeOtherAccess DeCode(byte[] data) throws IOException {
	Codec<SafeOtherAccess> Lcode = ProtobufProxy.create(SafeOtherAccess.class);
		return Lcode.decode(data);
	}

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "UserID")
    @Protobuf
	private String userID;
    @Column(name = "MaxOnline")
    @Protobuf
	private Integer maxOnline;
    @Column(name = "LevelPrice")
    @Protobuf
	private String levelPrice;
    @Column(name = "Dev")
    @Protobuf
	private String dev;
    @Column(name = "Reseach")
    @Protobuf
	private String reseach;
    @Column(name = "ReBack")
    @Protobuf
	private String reBack;
    @Column(name = "Trade")
    @Protobuf
	private String trade;
    @Column(name = "OwnUserID")
    @Protobuf
	private String ownUserID;
    @Column(name = "AlterUserID")
    @Protobuf
	private String alterUserID;
    @Column(name = "CreateTime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createTime;
	//@Protobuf
//tprivate long createTimeL;
    @Column(name = "TimeStamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date timeStamp;
	//@Protobuf
	//private long timeStampL;

    public SafeOtherAccess() {
    }

    public SafeOtherAccess(String userID) {
        this.userID = userID;
    }

    public String getUserID() {
        return userID;
    }

    public void setUserID(String userID) {
        this.userID = userID;
    }

    public Integer getMaxOnline() {
        return maxOnline;
    }

    public void setMaxOnline(Integer maxOnline) {
        this.maxOnline = maxOnline;
    }

    public String getLevelPrice() {
        return levelPrice;
    }

    public void setLevelPrice(String levelPrice) {
        this.levelPrice = levelPrice;
    }

    public String getDev() {
        return dev;
    }

    public void setDev(String dev) {
        this.dev = dev;
    }

    public String getReseach() {
        return reseach;
    }

    public void setReseach(String reseach) {
        this.reseach = reseach;
    }

    public String getReBack() {
        return reBack;
    }

    public void setReBack(String reBack) {
        this.reBack = reBack;
    }

    public String getTrade() {
        return trade;
    }

    public void setTrade(String trade) {
        this.trade = trade;
    }

    public String getOwnUserID() {
        return ownUserID;
    }

    public void setOwnUserID(String ownUserID) {
        this.ownUserID = ownUserID;
    }

    public String getAlterUserID() {
        return alterUserID;
    }

    public void setAlterUserID(String alterUserID) {
        this.alterUserID = alterUserID;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
		//this.createTimeL = CodeTool.DateToLong(createTime);
    }

    public Date getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(Date timeStamp) {
        this.timeStamp = timeStamp;
		//this.timeStampL = CodeTool.DateToLong(timeStamp);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (userID != null ? userID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SafeOtherAccess)) {
            return false;
        }
        SafeOtherAccess other = (SafeOtherAccess) object;
        if ((this.userID == null && other.userID != null) || (this.userID != null && !this.userID.equals(other.userID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jili.ubert.dao.db.SafeOtherAccess[ userID=" + userID + " ]";
    }
    
}
